package com.luo.demo.controller;

//import com.luo.demo.entity.User;

import com.luo.demo.entity.User;
import com.luo.demo.service.MyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
public class MyController {

    @Autowired
    MyService myService;

    @RequestMapping(value = "/login", method = RequestMethod.GET)
    public User login(@RequestParam("userName") String userName,
                        @RequestParam("password") String password) {
        User user = myService.getUser(userName,password);
        return user;
    }
}
